<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="${staticServer}/inc/style/main.css" />
<link rel="stylesheet" href="${staticServer}/inc/style/page.css" />
<link rel="stylesheet" href="${staticServer}/css/struct_info.css" />
<link rel="stylesheet" href="${staticServer}/inc/style/date/datepicker.css" />
<script src="${staticServer}/inc/js/jquery.js"></script>
<script src="${staticServer}/inc/js/pageset.js"></script>
<script src="${staticServer}/inc/js/submitter.js"></script>
<script src="${staticServer}/inc/js/datepicker.js"></script>
<script src="${staticServer}/js/web/system_user_base_modify.js?1.1"></script>

<script>
var contextPath='${contextPath}';

$(function(){
	//初始化数据
	$("#department").val("${userInfo.keynames}");
	$("#region").val("${userInfo.region}");
	$("#job").html('<option value="${userInfo.department}">${userInfo.job}</option>');
	$("#usergroup").val("${user.usergroup}");
	$("#qqgroup").val("${userInfo.qq_group}");
	$("#type").val("${userInfo.type}");
	
	//获取职位
	$('#department').on('click',function(){
		var keyname = $("#department").val();
		$.post("${contextPath}/index/getDepartment.json", {
			"keyname" : keyname
		}, function(ms) {
			var list = ms.departmentList;
			var objHtml = "";
			for(var i=0;i<list.length;i++){
				objHtml += '<option value="'+list[i].keyname+'">'+list[i].name+'</option>'
			}
			$("#job").html(objHtml);
		});
	});
	
	<#if userInfo??>
		<#if userInfo.usernames?? && userInfo.usernames!="">
		<#list userInfo.usernames?split(",") as name>
			$("#username${name_index?if_exists+1}").val("${name}");
		</#list>
		</#if>
	</#if>
});
</script>
</head>

<body>
<input type="hidden" id="username" value="${userInfo.username}">
	<div id="home_link">
		<ul>
			<li></li>
			<li>&gt;</li>
			<li>帐号管理</li>
			<li>&gt;</li>
			<li class="current">修改帐号基本信息</li>
		</ul>
	</div>
	<div id="container">
		<div id="title"></div>
		<table id="infotable">
			<tr>
				<th width="25%">姓名</th>
				<td width="75%"><input id="nickname" value="${userInfo.nickname}" /></td>
			</tr>
			<tr>
				<th>办公地址</th>
				<td>
				<select id="region">
					<#if offList??>
						<#list offList as list>
							<option value="${list.keyname}" title="${list.address}">${list.name}</option>
						</#list>
					</#if>
				</select>
				</td>
			</tr>
			<tr>
				<th>部门 / 职位</th>
				<td>
				<select id="department">
					<#if depList??>
						<#list depList as list>
							<option value="${list.keyname}">${list.name}</option>
						</#list>
					</#if>
				</select>
				<select id="job">
					<option value=""></option>
				</select>
				</td>
			</tr>
			<tr>
				<th>用户组
					<p class="caption">决定该帐号拥有哪些功能的使用权限</p>
				</th>
				<td>
				<select id="usergroup">
					<#if groupList??>
						<#list groupList as list>
							<option value="${list.id}">${list.name}</option>
						</#list>
					</#if>
				</select>
				</td>
			</tr>
			<tr>
				<th>岗位职责</th>
				<td>
				<select id="type">
					<option value="">请选择</option>
					<option value="1">中心主任</option>
					<option value="2">销售主管</option>
					<option value="3">职能主管</option>
					<option value="4">主管</option>
				</select>
				</td>
			</tr>
			
			<tr>
				<th>选择QQ分组</th>
				<td>
				<select id="qqgroup">
				<#if qqlist??>
					<option value="">请选择</option>
					<#list qqlist as list>
						<#if list.id!=1>
						<option value="${list.id}">${list.name}</option>
						</#if>
					</#list>
				</#if>
				</select></td>
			</tr>
			
			<tr>
				<th>选择转正日期
				</th>
				<td>
					<input type="text" id="zhuanz_date" value="${userInfo.zhuanz_date}" size="15" maxlength="20" rel="DATE::Y-m-d" />
				</td>
			</tr>
			<tr>
				<th>选择入职日期
				</th>
				<td>
					<input type="text" id="entryday" value="<#if userInfo.entryday?? && userInfo.entryday!=0>${userInfo.entrydays}</#if>" size="15" maxlength="20" rel="DATE::Y-m-d" />
				</td>
			</tr>
			<tr>
			<tr>
				<th>帐号
					<p class="caption">帐号名不能修改</p>
				</th>
				<td class="stress">${userInfo.username}</td>
			</tr>
			<tr>
				<th>锁定</th>
				<td><input type="checkbox" id="locked" <#if userInfo.locked == 1>checked</#if> /><label for="locked">锁定帐号<em class="caption">（锁定帐号，禁止登录使用）</em>
				</label></td>
			</tr>
			<tr>
				<th>密码
					<p class="caption">不修改密码，请保持空值</p>
				</th>
				<td><input id="password" type="password" size="50" maxlength="30" /></td>
			</tr>
			<tr>
				<th>确认密码</th>
				<td><input id="repassword" type="password" size="50" maxlength="30" /></td>
			</tr>
		</table>
		<div id="controlbar">
			<input type="submit" class="submit" value="  保存修改信息  " /> <input type="button" value="  返回帐号列表  "
				onclick="history.back()" />
		</div>
	</div>
</body>
</html>